package service

import (
	"go-demo/dao"
	"go-demo/model"
)

func FavoriteAction(actionType string, user model.User, videoId int64) {
	if actionType == "1" {
		//将用户id和视频id填入点赞表
		dao.CreateLike(user.Id, videoId)
	} else if actionType == "2" {
		dao.DeleteLike(user.Id, videoId)
	}
}

func FavoriteList(userId int64) []model.Video {
	videos, _ := dao.GetVideoByUserIDLike(userId)
	videoList := GetVideoList(videos)
	return videoList
}
